function EventEmitter() {

    this.events=[];//{event:,handler:}

    this.on = function (eventName,handler) {
        this.events.push({event:eventName,handler:handler});
        console.log(this.events);
    },
        this.emit = function (eventName) {
        var handler= this.events.find(function (event) {
                 return event.event==eventName;
          }).handler;

            handler();
        }

}


module.exports = {
    EventEmitter
}
